package com.zoweunion.mechanic.util.task;

import com.zoweunion.mechanic.service.FacilitatorPersonnelRelationService;
import com.zoweunion.mechanic.service.base.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * ktbl对接定时推送
 */
@Component
public class KtblPushTask extends BaseService {

    @Autowired
    private FacilitatorPersonnelRelationService relationService;

    /**
     * 卡特彼勒日推数据
     */
    // 每日1，2，3点推送三次
    @Scheduled(cron = "0 0 1,2,3 1/1 * ?")
    //@Scheduled(cron = "*/20 * * * * ? ")
    public void pushDay() {

        relationService.pushDay();
    }

    /**
     * 卡特彼勒月推数据
     */
    // 每月1号1，2，3点推送三次
    @Scheduled(cron = "0 0 1,2,3 1 1/1 ?")
    public void pushMonth() {
        relationService.pushMonth();
    }

    /**
     * 卡特彼勒thingsId推送
     */
    // 每小时
    @Scheduled(cron = "0 0 0/1 * * ?")
    public void pushThingsId() {
        relationService.pushThingsId();
    }
}
